const http = require('http')
const fs = require('fs')

const port = 8888
http
  .createServer(function(request, response) {
    console.log(port + '----', request.headers.host)
    const html = fs.readFileSync('./index.html', 'utf-8')
    response.writeHead(200, {
      'Content-Type': 'text/html'
    })
    response.end(html)
  })
  .listen(port)

console.log('server listen 8888')
